﻿using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.MSSQLDAL.TJDAL;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class DataForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Data_Binding();
            }
        }

        private void Data_Binding()
        {
            string ZiChanBianMa = Request.QueryString["GuDingZiChanBianMa"];           
            string BianMa = Request.QueryString["BianMa"];
            DateTime ShenQingRiQi = DateTime.Now;
            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/DataReport1.rdlc");
            Microsoft.Reporting.WebForms.ReportParameter c = new Microsoft.Reporting.WebForms.ReportParameter("ShenQingRiQi", ShenQingRiQi.ToString("yyyy-MM-dd HH:mm:ss"));
            this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { c });
            LSDAL dal = new LSDAL();
            DataTable dt1 = dal.GetAssetsList(BianMa);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt1));
            this.ReportViewer1.LocalReport.Refresh();
            //DataTable dt2 = dal.GetAssetsList();
            //this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt2));
            //    this.ReportViewer1.LocalReport.Refresh();
            //}
            //string ZiChanMingCheng = Request.QueryString["ZiChanMingCheng"];
            //string GouJianRiQi = Request.QueryString["GouJianRiQi"];
            //DateTime GouJianRiQi = Convert.ToDateTime(Request.QueryString["GouJianRiQi"]);
            //string GuiGeXingHao = Request.QueryString["XingHao"];
            //DateTime startTime = Convert.ToDateTime(Request.QueryString["SendConfirmedTime"]);
            //DateTime endTime = Convert.ToDateTime(Request.QueryString["CompletionTime"]);
            //Microsoft.Reporting.WebForms.ReportParameter a = new Microsoft.Reporting.WebForms.ReportParameter("ZiChanBianMa", ZiChanBianMa);
            //Microsoft.Reporting.WebForms.ReportParameter a = new Microsoft.Reporting.WebForms.ReportParameter("固定资产编码", ZiChanBianMa);
            //Microsoft.Reporting.WebForms.ReportParameter b = new Microsoft.Reporting.WebForms.ReportParameter("GouJianRiQi", GouJianRiQi);
        
        }
    }
}